<?php
// 本文档自动生成，仅供测试运行
import('Com.Auth');
class IndexAction extends Action//主页
{
	public function _initialize(){
		$this->assign('no',Auth::getno());
    	$this->assign('name',Auth::getname());
    	$this->assign('role',Auth::getrole());
	}
	/**
    +----------------------------------------------------------
    * 默认操作
    +----------------------------------------------------------
    */
    public function index()
    {
    	$form=D('course_detail');//精品
		$alist=$form->where('excellent=1')->order('pv desc')->limit(10)->select();
		$this->assign('alist',$alist);
		$form=D('course_detail');//所有
		$blist=$form->order('pv desc')->limit(10)->select();
		$this->assign('blist',$blist);
		$form=D('department');//所有
		$clist=$form->select();
		$this->assign('clist',$clist);
		D('index')->setInc('pv','id=1');
		$pv=D('index')->where('id=1')->getfield('pv');
		$this->assign('pv',$pv);
        $this->display();
    }

    /**
    +----------------------------------------------------------
    * 探针模式
    +----------------------------------------------------------
    */
    public function checkEnv()
    {
        load('pointer',THINK_PATH.'/Tpl/Autoindex');//载入探针函数
        $env_table = check_env();//根据当前函数获取当前环境
        echo $env_table;
    }
		
		
	
}
?>